package com.util.excel.web.controller;

import javax.servlet.http.HttpServletRequest;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;

import com.wen.common.base.BaseController;

/**
 * 导入excel文件，解析并生产xml文件
 * @date 2018年10月30日
 * @author W-L
 */
@Controller
@RequestMapping("/parseExcelToXmlController")
public class ParseExcelToXmlController extends BaseController{

	private Logger logger = Logger.getLogger(ParseExcelToXmlController.class);
	
	@RequestMapping("/index")
	public String index() {
		return "/excel/parseExcel.jsp";
	}
	
	@RequestMapping(value = "/impExcel",method = RequestMethod.POST)
	@ResponseBody
	public String impExcel(MultipartHttpServletRequest mrequest,HttpServletRequest request) {
		MultipartFile file = mrequest.getFile("excelTemp");
		System.out.println(file.getName());
		return "导入成功";
	}
}
